package com.itce.arco.practicenote.day02.practice2;

public class Test {
    public static void  main(String[] args){
        PingPongAthlete pingPongAthlete = new PingPongAthlete("王",18);
        pingPongAthlete.eat();
        pingPongAthlete.getName();
        pingPongAthlete.speakEnglish();

        FootballAthlete footballAthlete = new FootballAthlete("西", 18);
        footballAthlete.eat();
        footballAthlete.getName();

        PingPongCoach pingPongCoach = new PingPongCoach("乒乓球教练", 30);
        pingPongCoach.eat();
        pingPongCoach.speakEnglish();

        FootballCoach footballCoach = new FootballCoach("足球教练", 35);
        footballCoach.eat();
        footballCoach.getName();

        // 匿名局部内部类,属于一个参数多态
        Audience audience = new Audience();
        audience.watch(new Person("王",12) {
            @Override
            public void eat() {
                System.out.println(getName());
            }
        });
    }
}
